//
//  XMWebSocket.h
//  XMenSwift
//
//  Created by Jason on 2022/9/14.
//

#import <Foundation/Foundation.h>


NS_ASSUME_NONNULL_BEGIN

@protocol XMWebSocketDelegate <NSObject>

@optional
- (void)xmWebSocketDidReceiveMessage:(NSString *)message;

@end

@interface XMWebSocket : NSObject

@property (nonatomic,weak) id <XMWebSocketDelegate> delegate;

- (instancetype)initWithServerIp:(NSString *__nullable)serverIp;
- (void)connectWebSocket;
- (void)closeWebSocket;
- (void)sendMsg:(NSString *)msg;

@end

NS_ASSUME_NONNULL_END
